package com.foreknow.moxi.service.impl;

import com.foreknow.moxi.dao.AdminDao;
import com.foreknow.moxi.model.Admin;
import com.foreknow.moxi.service.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class AdminServiceImpl implements AdminService {
    @Autowired
    private AdminDao adminDao;

    @Override
    public Admin findByNameAndPassword(Admin admin) {
        return adminDao.findByNameAndPassword(admin);
    }

    @Override
    public List<Admin> findByAdminWithPage(Admin admin, int start, int end) {
        return adminDao.findByAdminWithPage(admin,start,end);
    }

    @Override
    public int insert(Admin admin) {
        return adminDao.insert(admin);
    }

    @Override
    public int updateStateById(int id) {
        return adminDao.updateStateById(id);
    }

    @Override
    public int deleteById(int id) {
        return adminDao.deleteById(id);
    }
}
